1. Field of Invention
This invention relates to an image processing method and system. More particularly, this invention classifies input image pixels into different classifications prior to output.
2. Description of Related Art
In digital reproduction of documents such as in the digital copier environment, a document is first optically scanned and converted to a gray scale image. In the case of color reproduction, the document may be converted to a gray scale image of several separations, such as the R, G and B separations. In order to produce a hard copy of the scanned and digitized image, the image has to be further processed according to the requirements of the marking engine. For example, if the marking engine is capable of bi-level printing, then the image has to be rendered into a 1-bit bit map for printing. To preserve the appearance of a gray scale image in a binary output, often some digital halftoning process is used in which the multi-bit input image is screened with a periodic array. However, if the original image itself contains halftone screen, objectionable moirxc3xa9patterns may occur due to the interference between the original and the new screens. Also, while dot screen halftoning may be good for rendering continuous tone originals, it may degrade the quality of text and line drawings. Often a document contains different types of images. In order to achieve optimal image quality in document reproduction, a system capable of automatically identifying different types of images within a page is needed. For example, if an image part is identified as halftone, then some kind of low-pass filtering may be applied prior to halftone screening so the gray scale appearance can be preserved without introducing moirxc3xa9patterns. For text area, some sharpness enhancement filter could be applied and other rendering techniques such as thresholding or error diffusion could be used.
Early work on image segmentation for the purpose of document reproduction dates back to the 1970s. U.S. Pat. No. 4,194,221, the subject matter of which is incorporated herein by reference, discloses a method for automatic multimode reproduction. It employs autocorrelation in halftone detection. Since then, a lot of work has been published in the area of image segmentation. See, for example, U.S. Pat. No. 4,740,843, the subject matter of which is incorporated herein by reference, discloses the method of halftone image detection by measuring the distance between successive gray level maxima. U.S. Pat. No. 5,341,277, the subject matter of which is incorporated herein by reference, discloses a dot image discrimination method that counts density change points within an area. One disadvantage that is common to the existing image segmentation systems is the rigidity of the system structure. Usually the system only provides several programmable parameters used for thresholds in detecting video maximum/minimum, halftone dot counting, etc. It does not provide much flexibility to support processing/rendering optimization and to cope with requirement change. There are other shortcomings in the existing segmentation systems that are related to using fixed threshold in halftone dot detection, using simple average in halftone dot counting, etc., which could result in misclassification in certain area.
The present invention provides a method and apparatus for classifying image data. In one embodiment, a video peak/valley counter may count one of peaks and valleys within a window of the input image data. A local roughness device may determine a local roughness of the input image data. In one embodiment, the input image data may be classified based on the count of the video peak/valley counter device and the local roughness of the local roughness detector.
In one embodiment, a neighborhood average gray value may be determined for the input image data. A pixel under consideration may be evaluated to determine if it is a peak or valley based on whether its brightness is greater or less than a peak threshold value or valley threshold value, which are based on the neighborhood average gray value.
In one embodiment, a peak/valley detection device may determine one of a peak and a valley count within a window of the image data around a pixel under consideration. A neighborhood checking device may check whether any video peaks or valleys are located within a neighborhood of the pixel under consideration.
In one embodiment, a halftone dot count of a window may be determined. If the determined halftone dot count is less than a predetermined number, then a neighborhood of the pixel under consideration is checked for any peaks and valleys. The data is then classified based on the number of peaks and valleys if there are any peaks or valleys within the neighborhood.
In one embodiment, pixels within a window may be evaluated to determine respective peaks and valleys. Each of the pixels within the window may be evaluated unless any pixel within a neighborhood of a desired pixel has previously been classified as a peak or valley.
In one embodiment, a processing device may determine a peak or valley within a window of the image data. The window may include a neighborhood of pixels about a specified pixel. The processing device may determine the peaks and valleys within the window unless a pixel within the neighborhood has been determined to be a peak or valley.
Other objects, advantages and salient features of the invention will become apparent from the following detailed description taken in conjunction with the annexed drawings which disclose preferred embodiments of the invention.